package keeto.com.vn.bms.ui.adapter;

import java.util.ArrayList;

import keeto.com.vn.bms.model.BasePopupModel;
import keeto.com.vn.bms.ui.activity.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class BasePopupAdapter extends BaseAdapter {

	private Context context;
	private LayoutInflater inflater;
	private ArrayList<BasePopupModel> mArrayList;
	
	public BasePopupAdapter(Context context,
			ArrayList<BasePopupModel> mArrayList) {
		this.context = context;
		this.mArrayList = mArrayList;
		this.inflater = LayoutInflater.from(context);
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return mArrayList.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return getItem(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		TextView tvName;
		convertView = inflater.inflate(R.layout.item_list_base_popup_layout,null);
		tvName = (TextView)convertView.findViewById(R.id.tv_base_popup_name);
		tvName.setText(mArrayList.get(position).getName());
		
		return convertView;
	}

}
